From: Giovanni Campagna Date: Fri, 30 Nov 2012 15:14:50 +0000 (+0100) Subject: MessageTray: don't close the tray when interacting with the right click menu X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~5342 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=961dba7faad79666d7d4317f71e0fa2c9725d889;p=gnome-shell.git MessageTray: don't close the tray when interacting with the right click menu If the chosen action is not open, the tray should not be closed, to let the user further interact with it (for example to mute or remove more sources) https://bugzilla.gnome.org/show_bug.cgi?id=689296 --- diff --git a/js/ui/components/telepathyClient.js b/js/ui/components/telepathyClient.js index ddceb345d..b3a303ab0 100644 --- a/js/ui/components/telepathyClient.js +++ b/js/ui/components/telepathyClient.js @@ -478,7 +478,7 @@ const ChatSource = new Lang.Class({ })); item.connect('activate', Lang.bind(this, function() { this.setMuted(!this.isMuted); - this.emit('done-displaying-content'); + this.emit('done-displaying-content', false); })); rightClickMenu.add(item.actor); return rightClickMenu; diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 35665bd5a..6fba5dd6d 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -1088,14 +1088,14 @@ const Source = new Lang.Class({ item = new PopupMenu.PopupMenuItem(_("Open")); item.connect('activate', Lang.bind(this, function() { this.open(); - this.emit('done-displaying-content'); + this.emit('done-displaying-content', true); })); rightClickMenu.add(item.actor); item = new PopupMenu.PopupMenuItem(_("Remove")); item.connect('activate', Lang.bind(this, function() { this.destroy(); - this.emit('done-displaying-content'); + this.emit('done-displaying-content', false); })); rightClickMenu.add(item.actor); return rightClickMenu; @@ -1341,7 +1341,7 @@ const SummaryItem = new Lang.Class({ }, _notificationDoneDisplaying: function() { - this.source.emit('done-displaying-content'); + this.source.emit('done-displaying-content', true); }, _notificationDestroyed: function(notification) { @@ -2454,12 +2454,21 @@ const MessageTray = new Lang.Class({ }); }, + _onSourceDoneDisplayingContent: function(source, closeTray) { + if (closeTray) { + this._escapeTray(); + } else { + this._setClickedSummaryItem(null); + this._updateState(); + } + }, + _showSummaryBoxPointer: function() { this._summaryBoxPointerItem = this._clickedSummaryItem; this._summaryBoxPointerContentUpdatedId = this._summaryBoxPointerItem.connect('content-updated', Lang.bind(this, this._onSummaryBoxPointerContentUpdated)); this._sourceDoneDisplayingId = this._summaryBoxPointerItem.source.connect('done-displaying-content', - Lang.bind(this, this._escapeTray)); + Lang.bind(this, this._onSourceDoneDisplayingContent)); let hasRightClickMenu = this._summaryBoxPointerItem.rightClickMenu != null; if (this._clickedSummaryItemMouseButton == 1 || !hasRightClickMenu) {